package com.softer.wxzj.common.util;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.concurrent.atomic.AtomicInteger;

/**
 * 生成编号
 *
 * @author Gong Zhiyang
 * @date 2019/7/17
 */

public class NoUtil {
    private static final AtomicInteger atomicInteger = new AtomicInteger(100000);

    public static synchronized String getOrderNo() {
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMddHHmmss");
        atomicInteger.getAndIncrement();
        int i = atomicInteger.get();
        String date = simpleDateFormat.format(new Date());
        return  date + i;
    }
}
